var express = require('express');
var router = express.Router();
const { getOrders, updateOrders, updateOrdersId, deleteOrders } = require('../../service/salers/orderService')

//获取所有订单
router.get('/getOrders', async (req, res, next) => {
  res.send(await getOrders(req.query));
});
//获取修改订单ID
router.get('/updateOrdersId', async function (req, res, next) {
  console.log(req.query, 555);
  let data = await updateOrdersId(req.query);
  res.send(data);
});
//修改订单
router.post('/updateOrders', async function (req, res, next) {
  let data = await updateOrders(req.body);
  res.send(data);
});
//删除订单
router.post('/deleteOrders', async function (req, res, next) {
  console.log(req.body);
  let data = await deleteOrders(req.body);
  res.send(data);
});


module.exports = router;